import Vue from 'vue';
import VueRouter from 'vue-router';
import Foo from './components/Foo.vue'
import Bar from './components/Bar.vue'
Vue.use(VueRouter);// 内部会提供两个全局组件 Vue.component()

// 每个人访问服务器都需要产生一个路由系统---导出函数，单例

export default ()=>{
    let router = new VueRouter({
        mode:'history',
        routes:[
            {path:'/',component:Foo},
            // {path:'/bar',component:()=>import('./components/Bar.vue')},
            {path:'/bar',component:Bar},
        ]
    })
    return router
}
